<?php

namespace App\Http\Controllers\Api;

use App;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class FileController extends Controller
{
    public function store(Request $request) {
        $file = $request->file;
        $name = $file->getClientOriginalName();
        $path = $file->getRealPath();

        $client = App::make('aliyun-oss');
        $result =  $client->uploadFile('loadme', $name, $path);
//        $result = $client->getObject("loadme", $name,['OSS_FILE_DOWNLOAD']);
        echo json_encode($result);
    }


    public function destroy(Request $request) {

    }

}
